package com.situ.mall.controller;

import com.situ.mall.pojo.vo.ProductOrderVO;
import com.situ.mall.service.IOrderItemService;
import com.situ.mall.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/echarts")
public class Echarts {
    @Autowired
    private IOrderItemService orderItemService;

    @RequestMapping("/getData")
    @ResponseBody
    public List<ProductOrderVO> getData() {
        return orderItemService.selectData();
    }

    @RequestMapping("/getEchartsPage")
    public String getEchartsPage() {
        return "echarts";
    }

    @RequestMapping("/getMonth")
    @ResponseBody
    public List<ProductOrderVO> getMonth() {
        return orderItemService.selectMonth();
    }
}
